package com.doit.day01.op

object MinByDemo {
  def main(args: Array[String]): Unit = {

    val map: Map[String, Int] = Map(("zss", 18), ("lss", 28), ("ww", 39), ("zl", 16))


    //map(key,value)  ==> Tuple2   我们又叫他对偶元组

    //仅仅是根据元组中得第一个元素判断，哪一个是最小值，然后返回给我们得是整个得一个kv对(对偶元组)
    val tuple: (String, Int) = map.minBy(_._1)
    println(tuple)


    val tuple1: (String, Int) = map.maxBy(_._2)
    println(tuple1)




  }

}
